#define _CRT_SECURE_NO_WARNINGS 1

#include <vector>

using namespace std;
class Solution {
public:
    int removeDuplicates(vector<int>& nums) {
        if (nums.size() == 1)
            return 1;
        int mov = 1;
        while (mov < nums.size())
        {
            if (nums[mov - 1] == nums[mov])
            {
                nums.erase(nums.begin() + mov);
            }
            else
            {
                ++mov;
            }
        }
        return nums.size();
    }
};